﻿CREATE TABLE [dbo].[DimTime]
(
[TimeFull] [nvarchar] (30) NOT NULL,
[TimeHour_24Hr] [int] NOT NULL,
[timeMinute] [int] NOT NULL,
[AM_PM] [nvarchar] (50) NULL,
[TimeHour_12Hr] [int] NULL,
[TimeText] [nvarchar] (50) NULL,
[TimeID_key] [int] NOT NULL IDENTITY(1, 1),
[Time_Range] AS (case when [TimeHour_24Hr]>(8) AND [TimeHour_24Hr]<(13) then '9 to 12 AM' when [TimeHour_24Hr]>(12) AND [TimeHour_24Hr]<(18) then '1 to 5 PM' when [TimeHour_24Hr]>(17) AND [TimeHour_24Hr]<(25) then '6 to 12 PM' when [TimeHour_24Hr]>(0) AND [TimeHour_24Hr]<(9) then '1 to 8 AM'  end),
[Minute_Range] AS (case when [TimeMinute]<(16) then '0 to 15 Minutes' when [TimeMinute]>(15) AND [TimeMinute]<(31) then '16 to 30 Minutes' when [TimeMinute]>(30) AND [TimeMinute]<(46) then '31 to 45 Minutes' when [TimeMinute]>(45) AND [TimeMinute]<(61) then '46 to 60 Minutes'  end)
) ON [PRIMARY]


